package grimbo.goodwinfooty.processing;

import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Map;

public class XLS2InputStreamProcessor implements Processor {
	public final static String CTX_XLS_FILE_NAME = "xlsFilename";
	public final static String CTX_XLS_INPUT_STREAM = "xlsInputStream";

	public String process(Map context) throws Exception {
		InputStream in = (InputStream) context.get(CTX_XLS_INPUT_STREAM);
		if (null != in) {
			return null;
		}
		String xlsFilename = (String) context.get(CTX_XLS_FILE_NAME);
		in = new FileInputStream(xlsFilename);
		context.put(CTX_XLS_INPUT_STREAM, in);
		return null;
	}
}
